package com.shen.test;

import com.shen.teacher.Teacher;

/**
 * Author:shen
 * CreateDate:2020/5/18.
 * Function:
 */
public class MyTest03 {
    public static void main(String[] args) {
        Teacher teacher=new Teacher("李老师",24,"学校");
        try {
            if(teacher.getAge()<22){
                throw new Exception("年龄少于22岁");
            }
            teacher.self();
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
